package com.gxa.service.impl;

import com.gxa.common.uitls.GyUitls;
import com.gxa.dto.UserDto;
import com.gxa.entity.User;
import com.gxa.mapper.EmpMapper;
import com.gxa.mapper.UserMapper;
import com.gxa.service.UserService;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {


    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> loginOut(UserDto userDto) {
        List<User> users=this.userMapper.loginout(userDto);
        return users;
    }

    @Override
    public List<User> queryAll(UserDto userDto) {
        List<User> users=this.userMapper.queryAll(userDto);
        return users;
    }

    @Override
    public void updateLimit(UserDto userDto) {

        this.userMapper.updateLimit(userDto);
    }

    @Override
    public void updatePwdAndTel(UserDto userDto) {
        this.userMapper.updatePwd(userDto);
        this.userMapper.updateTel(userDto);
    }

    @Override
    public User queryByOldPwdAndUname(String username, String password) {
        User user = this.userMapper.queryByUserNameAndPwd(username, password);
        return user;
    }

    @Override
    public List<String> queryTelByUname(String uname) {
        List<String> tel= this.userMapper.queryTelByUname(uname);
        return tel;
    }


}
